home *** CD-ROM | disk | FTP | other *** search
-
-
-
- SSSSTTTTRRRREEEEAAAAMMMMIIIIOOOO((((7777)))) SSSSTTTTRRRREEEEAAAAMMMMIIIIOOOO((((7777))))
-
-
-
- NNNNAAAAMMMMEEEE
- streamio - STREAMS ioctl commands
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- ####iiiinnnncccclllluuuuddddeeee <<<<ssssttttrrrrooooppppttttssss....hhhh>>>>
- iiiinnnntttt iiiiooooccccttttllll ((((ffffiiiillllddddeeeessss,,,, ccccoooommmmmmmmaaaannnndddd,,,, aaaarrrrgggg))))
- iiiinnnntttt ffffiiiillllddddeeeessss,,,, ccccoooommmmmmmmaaaannnndddd;;;;
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- STREAMS [see _i_n_t_r_o(2)] ioctl commands are a subset of _i_o_c_t_l(2) system
- calls which perform a variety of control functions on _s_t_r_e_a_m_s. The
- arguments _c_o_m_m_a_n_d and _a_r_g are passed to the file designated by _f_i_l_d_e_s and
- are interpreted by the _s_t_r_e_a_m _h_e_a_d. Certain combinations of these
- arguments may be passed to a module or driver in the _s_t_r_e_a_m.
-
- _f_i_l_d_e_s is an open file descriptor that refers to a _s_t_r_e_a_m. _c_o_m_m_a_n_d
- determines the control function to be performed as described below. _a_r_g
- represents additional information that is needed by this command. The
- type of _a_r_g depends upon the command, but it is generally an integer or a
- pointer to a _c_o_m_m_a_n_d-specific data structure.
-
- Since these STREAMS commands are a subset of _i_o_c_t_l, they are subject to
- the errors described there. In addition to those errors, the call will
- fail with _e_r_r_n_o set to EINVAL, without processing a control function, if
- the _s_t_r_e_a_m referenced by _f_i_l_d_e_s is linked below a multiplexor, or if
- _c_o_m_m_a_n_d is not a valid value for a _s_t_r_e_a_m.
-
- Also, as described in _i_o_c_t_l, STREAMS modules and drivers can detect
- errors. In this case, the module or driver sends an error message to the
- _s_t_r_e_a_m _h_e_a_d containing an error value. This causes subsequent system
- calls to fail with _e_r_r_n_o set to this value.
-
- In previous IRIX releases it was possible to use these operations on
- socket file descriptors by linking with -_l_s_o_c_k_e_t; this is no longer true
- starting with IRIX 6.2.
-
- CCCCOOOOMMMMMMMMAAAANNNNDDDD FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNNSSSS
- The following _i_o_c_t_l commands, with error values indicated, are applicable
- to all STREAMS files:
-
- I_PUSH Pushes the module whose name is pointed to by _a_r_g onto the
- top of the current _s_t_r_e_a_m, just below the _s_t_r_e_a_m _h_e_a_d. It
- then calls the open routine of the newly-pushed module. On
- failure, _e_r_r_n_o is set to one of the following values:
-
- [EINVAL] Invalid module name.
-
- [EFAULT] _a_r_g points outside the allocated address space.
-
- [ENXIO] Open routine of new module failed.
-
-
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- SSSSTTTTRRRREEEEAAAAMMMMIIIIOOOO((((7777)))) SSSSTTTTRRRREEEEAAAAMMMMIIIIOOOO((((7777))))
-
-
-
- [ENXIO] Hangup received on _f_i_l_d_e_s.
-
- I_POP Removes the module just below the _s_t_r_e_a_m _h_e_a_d of the _s_t_r_e_a_m
- pointed to by _f_i_l_d_e_s. _a_r_g should be 0 in an I_POP request.
- On failure, _e_r_r_n_o is set to one of the following values:
-
- [EINVAL] No module present in the _s_t_r_e_a_m.
-
- [ENXIO] Hangup received on _f_i_l_d_e_s.
-
- I_LOOK Retrieves the name of the module just below the _s_t_r_e_a_m _h_e_a_d
- of the _s_t_r_e_a_m pointed to by _f_i_l_d_e_s, and places it in a null
- terminated character string pointed at by _a_r_g. The buffer
- pointed to by _a_r_g should be at least FMNAMESZ+1 bytes long.
- An [#include <sys/conf.h>] declaration is required. On
- failure, _e_r_r_n_o is set to one of the following values:
-
- [EFAULT] _a_r_g points outside the allocated address space.
-
- [EINVAL] No module present in _s_t_r_e_a_m.
-
- I_LIST Retrieves the entire list of modules between the _s_t_r_e_a_m _h_e_a_d
- of the _s_t_r_e_a_m pointed to by _f_i_l_d_e_s, and the driver. If _a_r_g
- is NULL, then the number of modules is returned. Otherwise,
- _a_r_g should point to a _s_t_r_u_c_t _s_t_r__l_i_s_t. On input, the member
- _s_l__n_m_o_d_s should be set to the maximum number of module name
- the caller is ready to accept, and the member _s_l__m_o_d_l_i_s_t
- should point to an array of _s_t_r_u_c_t _s_t_r__m_l_i_s_t dats structures
- with at least _s_t_r__n_m_o_d_s elements. On successful return, the
- member _s_l__n_m_o_d_s will be updated to reflect the actual number
- of module names returned. On failure, _e_r_r_n_o is set to one
- of the following values:
-
- [EFAULT] _a_r_g points outside the allocated address space.
-
- [EINVAL] The value of _s_l__n_m_o_d_s is less than or equal to
- zero.
-
- [ENOSPC] The value of _s_l__n_m_o_d_s is less than the actual
- number of modules.
-
- I_FLUSH This request flushes all input and/or output queues,
- depending on the value of _a_r_g. Legal _a_r_g values are:
-
- FLUSHR Flush read queues.
-
- FLUSHW Flush write queues.
-
- FLUSHRW Flush read and write queues.
-
-
-
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-
-
-
- SSSSTTTTRRRREEEEAAAAMMMMIIIIOOOO((((7777)))) SSSSTTTTRRRREEEEAAAAMMMMIIIIOOOO((((7777))))
-
-
-
- On failure, _e_r_r_n_o is set to one of the following values:
-
- [ENOSR] Unable to allocate buffers for flush message
- due to insufficient STREAMS memory resources.
-
- [EINVAL] Invalid _a_r_g value.
-
- [ENXIO] Hangup received on _f_i_l_d_e_s.
-
- I_SETSIG Informs the _s_t_r_e_a_m _h_e_a_d that the user wishes the kernel to
- issue the SIGPOLL signal [see _s_i_g_n_a_l(2) and _s_i_g_s_e_t(2)] when
- a particular event has occurred on the _s_t_r_e_a_m associated
- with _f_i_l_d_e_s. I_SETSIG supports an asynchronous processing
- capability in STREAMS. The value of _a_r_g is a bitmask that
- specifies the events for which the user should be signaled.
- It is the bitwise-OR of any combination of the following
- constants:
-
- S_INPUT A non-priority message has arrived on a _s_t_r_e_a_m
- _h_e_a_d read queue, and no other messages existed
- on that queue before this message was placed
- there. This is set even if the message is of
- zero length.
-
- S_HIPRI A priority message is present on the _s_t_r_e_a_m
- _h_e_a_d read queue. This is set even if the
- message is of zero length.
-
- S_OUTPUT The write queue just below the _s_t_r_e_a_m _h_e_a_d is
- no longer full. This notifies the user that
- there is room on the queue for sending (or
- writing) data downstream.
-
- S_MSG A STREAMS signal message that contains the
- SIGPOLL signal has reached the front of the
- _s_t_r_e_a_m _h_e_a_d read queue.
-
- A user process may choose to be signaled only of priority
- messages by setting the _a_r_g bitmask to the value S_HIPRI.
-
- Processes that wish to receive SIGPOLL signals must
- explicitly register to receive them using I_SETSIG. If
- several processes register to receive this signal for the
- same event on the same Stream, each process will be signaled
- when the event occurs.
-
- If the value of _a_r_g is zero, the calling process will be
- unregistered and will not receive further SIGPOLL signals.
- On failure, _e_r_r_n_o is set to one of the following values:
-
-
-
-
-
-
- PPPPaaaaggggeeee 3333
-
-
-
-
-
-
- SSSSTTTTRRRREEEEAAAAMMMMIIIIOOOO((((7777)))) SSSSTTTTRRRREEEEAAAAMMMMIIIIOOOO((((7777))))
-
-
-
- [EINVAL] _a_r_g value is invalid or _a_r_g is zero and process
- is not registered to receive the SIGPOLL
- signal.
-
- [EAGAIN] Allocation of a data structure to store the
- signal request failed.
-
- I_GETSIG Returns the events for which the calling process is
- currently registered to be sent a SIGPOLL signal. The
- events are returned as a bitmask pointed to by _a_r_g, where
- the events are those specified in the description of
- I_SETSIG above. _a_r_g is assumed to point to an iiiinnnntttt. On
- failure, _e_r_r_n_o is set to one of the following values:
-
- [EINVAL] Process not registered to receive the SIGPOLL
- signal.
-
- [EFAULT] _a_r_g points outside the allocated address space.
-
- I_FIND Compares the names of all modules currently present in the
- _s_t_r_e_a_m to the name pointed to by _a_r_g, and returns 1 if the
- named module is present in the _s_t_r_e_a_m. It returns 0 if the
- named module is not present. On failure, _e_r_r_n_o is set to
- one of the following values:
-
- [EFAULT] _a_r_g points outside the allocated address space.
-
- [EINVAL] _a_r_g does not contain a valid module name.
-
- I_PEEK Allows a user to retrieve the information in the first
- message on the _s_t_r_e_a_m _h_e_a_d read queue without taking the
- message off the queue. _a_r_g points to a _s_t_r_p_e_e_k structure
- which contains the following members:
- struct strbufctlbuf;
- struct strbufdatabuf;
- long flags;
- The _m_a_x_l_e_n field in the _c_t_l_b_u_f and _d_a_t_a_b_u_f _s_t_r_b_u_f structures
- [see _g_e_t_m_s_g(2)] must be set to the number of bytes of
- control information and/or data information, respectively,
- to retrieve. If the user sets _f_l_a_g_s to RS_HIPRI, I_PEEK
- will only look for a priority message on the _s_t_r_e_a_m _h_e_a_d
- read queue.
-
- I_PEEK returns 1 if a message was retrieved, and returns 0
- if no message was found on the _s_t_r_e_a_m _h_e_a_d read queue, or if
- the RS_HIPRI flag was set in _f_l_a_g_s and a priority message
- was not present on the _s_t_r_e_a_m _h_e_a_d read queue. It does not
- wait for a message to arrive. On return, _c_t_l_b_u_f specifies
- information in the control buffer, _d_a_t_a_b_u_f specifies
- information in the data buffer, and _f_l_a_g_s contains the value
- 0 or RS_HIPRI. On failure, _e_r_r_n_o is set to the following
-
-
-
- PPPPaaaaggggeeee 4444
-
-
-
-
-
-
- SSSSTTTTRRRREEEEAAAAMMMMIIIIOOOO((((7777)))) SSSSTTTTRRRREEEEAAAAMMMMIIIIOOOO((((7777))))
-
-
-
- value:
-
- [EFAULT] _a_r_g points, or the buffer area specified in
- _c_t_l_b_u_f or _d_a_t_a_b_u_f is, outside the allocated
- address space.
-
- [EBADMSG] Queued message to be read is not valid for
- I_PEEK
-
- I_SRDOPT Sets the read mode using the value of the argument _a_r_g.
- Legal _a_r_g values are:
-
- RNORM Byte-stream mode, the default.
-
- RMSGD Message-discard mode.
-
- RMSGN Message-nondiscard mode.
-
- Read modes are described in _r_e_a_d(2). On failure, _e_r_r_n_o is
- set to the following value:
-
- [EINVAL] _a_r_g is not one of the above legal values.
-
- I_GRDOPT Returns the current read mode setting in an _i_n_t pointed to
- by the argument _a_r_g. Read modes are described in _r_e_a_d(2).
- On failure, _e_r_r_n_o is set to the following value:
-
- [EFAULT] _a_r_g points outside the allocated address space.
-
- I_NREAD Counts the number of data bytes in data blocks in the first
- message on the _s_t_r_e_a_m _h_e_a_d read queue, and places this value
- in the location pointed to by _a_r_g. _a_r_g is assumed to be a
- pointer to an iiiinnnntttt. The return value for the command is the
- number of messages on the _s_t_r_e_a_m _h_e_a_d read queue. For
- example, if zero is returned in _a_r_g, but the _i_o_c_t_l return
- value is greater than zero, this indicates that a zero-
- length message is next on the queue. On failure, _e_r_r_n_o is
- set to the following value:
-
- [EFAULT] _a_r_g points outside the allocated address space.
-
- I_FDINSERT Creates a message from user specified buffer(s), adds
- information about another _s_t_r_e_a_m and sends the message
- downstream. The message contains a control part and an
- optional data part. The data and control parts to be sent
- are distinguished by placement in separate buffers, as
- described below.
-
- _a_r_g points to a _s_t_r_f_d_i_n_s_e_r_t structure which contains the
- following members:
- struct strbufctlbuf;
- struct strbufdatabuf;
-
-
- PPPPaaaaggggeeee 5555
-
-
-
-
-
-
- SSSSTTTTRRRREEEEAAAAMMMMIIIIOOOO((((7777)))) SSSSTTTTRRRREEEEAAAAMMMMIIIIOOOO((((7777))))
-
-
-
- long flags;
- int fildes;
- int offset;
- The _l_e_n field in the _c_t_l_b_u_f _s_t_r_b_u_f structure [see _p_u_t_m_s_g(2)]
- must be set to the size of a pointer plus the number of
- bytes of control information to be sent with the message.
- _f_i_l_d_e_s in the _s_t_r_f_d_i_n_s_e_r_t structure specifies the file
- descriptor of the other _s_t_r_e_a_m. _o_f_f_s_e_t, which must be
- word-aligned, specifies the number of bytes beyond the
- beginning of the control buffer where I_FDINSERT will store
- a pointer. This pointer will be the address of the read
- queue structure of the driver for the _s_t_r_e_a_m corresponding
- to _f_i_l_d_e_s in the _s_t_r_f_d_i_n_s_e_r_t structure. The _l_e_n field in
- the _d_a_t_a_b_u_f _s_t_r_b_u_f structure must be set to the number of
- bytes of data information to be sent with the message or
- zero if no data part is to be sent.
-
- _f_l_a_g_s specifies the type of message to be created. A non-
- priority message is created if _f_l_a_g_s is set to 0, and a
- priority message is created if _f_l_a_g_s is set to RS_HIPRI.
- For non-priority messages, I_FDINSERT will block if the
- _s_t_r_e_a_m write queue is full due to internal flow control
- conditions. For priority messages, I_FDINSERT does not
- block on this condition. For non-priority messages,
- I_FDINSERT does not block when the write queue is full and
- O_NDELAY is set. Instead, it fails and sets _e_r_r_n_o to
- EAGAIN.
-
- I_FDINSERT also blocks, unless prevented by lack of internal
- resources, waiting for the availability of message blocks in
- the _s_t_r_e_a_m, regardless of priority or whether O_NDELAY has
- been specified. No partial message is sent. On failure,
- _e_r_r_n_o is set to one of the following values:
-
- [EAGAIN] A non-priority message was specified, the
- O_NDELAY flag is set, and the _s_t_r_e_a_m write
- queue is full due to internal flow control
- conditions.
-
- [ENOSR] Buffers could not be allocated for the message
- that was to be created due to insufficient
- STREAMS memory resources.
-
- [EFAULT] _a_r_g points, or the buffer area specified in
- _c_t_l_b_u_f or _d_a_t_a_b_u_f is, outside the allocated
- address space.
-
- [EINVAL] One of the following: _f_i_l_d_e_s in the
- _s_t_r_f_d_i_n_s_e_r_t structure is not a valid, open
- _s_t_r_e_a_m file descriptor; the size of a pointer
- plus _o_f_f_s_e_t is greater than the _l_e_n field for
- the buffer specified through _c_t_l_p_t_r; _o_f_f_s_e_t
-
-
- PPPPaaaaggggeeee 6666
-
-
-
-
-
-
- SSSSTTTTRRRREEEEAAAAMMMMIIIIOOOO((((7777)))) SSSSTTTTRRRREEEEAAAAMMMMIIIIOOOO((((7777))))
-
-
-
- does not specify a properly-aligned location in
- the data buffer; an undefined value is stored
- in _f_l_a_g_s.
-
- [ENXIO] Hangup received on _f_i_l_d_e_s of the _i_o_c_t_l call or
- _f_i_l_d_e_s in the _s_t_r_f_d_i_n_s_e_r_t structure.
-
- [ERANGE] The _l_e_n field for the buffer specified through
- _d_a_t_a_b_u_f does not fall within the range
- specified by the maximum and minimum packet
- sizes of the topmost _s_t_r_e_a_m module, or the _l_e_n
- field for the buffer specified through _d_a_t_a_b_u_f
- is larger than the maximum configured size of
- the data part of a message, or the _l_e_n field
- for the buffer specified through _c_t_l_b_u_f is
- larger than the maximum configured size of the
- control part of a message.
-
- I_FDINSERT can also fail if an error message was received by
- the _s_t_r_e_a_m _h_e_a_d of the _s_t_r_e_a_m corresponding to _f_i_l_d_e_s in the
- _s_t_r_f_d_i_n_s_e_r_t structure. In this case, _e_r_r_n_o will be set to
- the value in the message.
-
- I_STR Constructs an internal STREAMS ioctl message from the data
- pointed to by _a_r_g, and sends that message downstream.
-
- This mechanism is provided to send user _i_o_c_t_l requests to
- downstream modules and drivers. It allows information to be
- sent with the _i_o_c_t_l, and will return to the user any
- information sent upstream by the downstream recipient.
- I_STR blocks until the system responds with either a
- positive or negative acknowledgement message, or until the
- request "times out" after some period of time. If the
- request times out, it fails with _e_r_r_n_o set to ETIME.
-
- At most, one I_STR can be active on a _s_t_r_e_a_m. Further I_STR
- calls will block until the active I_STR completes at the
- _s_t_r_e_a_m _h_e_a_d. The default timeout interval for these
- requests is 15 seconds. The O_NDELAY [see _o_p_e_n(2)] flag has
- no effect on this call.
-
- To send requests downstream, _a_r_g must point to a _s_t_r_i_o_c_t_l
- structure which contains the following members:
- int ic_cmd; /* downstream command */
- int ic_timout;/* ACK/NAK timeout */
- int ic_len; /* length of data arg */
- char *ic_dp; /* ptr to data arg */
-
- _i_c__c_m_d is the internal ioctl command intended for a
- downstream module or driver and _i_c__t_i_m_o_u_t is the number of
- seconds (-1 = infinite, 0 = use default, >0 = as specified)
- an I_STR request will wait for acknowledgement before timing
-
-
- PPPPaaaaggggeeee 7777
-
-
-
-
-
-
- SSSSTTTTRRRREEEEAAAAMMMMIIIIOOOO((((7777)))) SSSSTTTTRRRREEEEAAAAMMMMIIIIOOOO((((7777))))
-
-
-
- out. _i_c__l_e_n is the number of bytes in the data argument and
- _i_c__d_p is a pointer to the data argument. The _i_c__l_e_n field
- has two uses: on input, it contains the length of the data
- argument passed in, and on return from the command, it
- contains the number of bytes being returned to the user (the
- buffer pointed to by _i_c__d_p should be large enough to contain
- the maximum amount of data that any module or the driver in
- the _s_t_r_e_a_m can return).
-
- The _s_t_r_e_a_m _h_e_a_d will convert the information pointed to by
- the _s_t_r_i_o_c_t_l structure to an internal ioctl command message
- and send it downstream. On failure, _e_r_r_n_o is set to one of
- the following values:
-
- [ENOSR] Unable to allocate buffers for the _i_o_c_t_l
- message due to insufficient STREAMS memory
- resources.
-
- [EFAULT] _a_r_g points, or the buffer area specified by
- _i_c__d_p and _i_c__l_e_n (separately for data sent and
- data returned) is, outside the allocated
- address space.
-
- [EINVAL] _i_c__l_e_n is less than 0 or _i_c__l_e_n is larger than
- the maximum configured size of the data part of
- a message or _i_c__t_i_m_o_u_t is less than -1.
-
- [ENXIO] Hangup received on _f_i_l_d_e_s.
-
- [ETIME] A downstream _i_o_c_t_l timed out before
- acknowledgement was received.
-
- An I_STR can also fail while waiting for an acknowledgement
- if a message indicating an error or a hangup is received at
- the _s_t_r_e_a_m _h_e_a_d. In addition, an error code can be returned
- in the positive or negative acknowledgement message, in the
- event the ioctl command sent downstream fails. For these
- cases, I_STR will fail with _e_r_r_n_o set to the value in the
- message.
-
- I_SWROPT Sets the write mode bits using the value of the argument
- _a_r_g. Legal bit settings for _a_r_g are:
-
- SNDZERO Send a zero-length message downstream when a
- write of 0 bytes occurs on pipes and FIFOs.
-
- SNDPIPE Send SIGPIPE to process if _ssss_dddd______wwww_eeee_rrrr_rrrr_oooo_rrrr is set and
- the process is doing a write or putmsg.
-
- SNDHOLD Activate the STRHOLD feature.
-
-
-
-
-
- PPPPaaaaggggeeee 8888
-
-
-
-
-
-
- SSSSTTTTRRRREEEEAAAAMMMMIIIIOOOO((((7777)))) SSSSTTTTRRRREEEEAAAAMMMMIIIIOOOO((((7777))))
-
-
-
- On failure, _eeee_rrrr_rrrr_nnnn_oooo may be set to the following value:
-
- EINVAL _a_r_g is not a valid value.
-
- I_GWROPT Returns the current write mode setting, as described above,
- in the _iiii_nnnn_tttt that is pointed to by the argument _a_r_g.
-
- I_SENDFD Requests the _s_t_r_e_a_m associated with _f_i_l_d_e_s to send a
- message, containing a file pointer, to the _s_t_r_e_a_m _h_e_a_d at
- the other end of a _s_t_r_e_a_m pipe. The file pointer
- corresponds to _a_r_g, which must be an integer file
- descriptor.
-
- I_SENDFD converts _a_r_g into the corresponding system file
- pointer. It allocates a message block and inserts the file
- pointer in the block. The user id and group id associated
- with the sending process are also inserted. This message is
- placed directly on the read queue [see _i_n_t_r_o(2)] of the
- _s_t_r_e_a_m _h_e_a_d at the other end of the _s_t_r_e_a_m pipe to which it
- is connected. On failure, _e_r_r_n_o is set to one of the
- following values:
-
- [EAGAIN] The sending _s_t_r_e_a_m is unable to allocate a
- message block to contain the file pointer.
-
- [EAGAIN] The read queue of the receiving _s_t_r_e_a_m _h_e_a_d is
- full and cannot accept the message sent by
- I_SENDFD.
-
- [EBADF] _a_r_g is not a valid, open file descriptor.
-
- [EINVAL] _f_i_l_d_e_s is not connected to a _s_t_r_e_a_m pipe.
-
- [ENXIO] Hangup received on _f_i_l_d_e_s.
-
- I_RECVFD Retrieves the file descriptor associated with the message
- sent by an I_SENDFD _i_o_c_t_l over a _s_t_r_e_a_m pipe. _a_r_g is a
- pointer to a data buffer large enough to hold an _s_t_r_r_e_c_v_f_d
- data structure containing the following members:
- int fd;
- uid_t uid;
- gid_t gid;
-
- _f_d is an integer file descriptor. _u_i_d and _g_i_d are the user
- id and group id, respectively, of the sending _s_t_r_e_a_m.
-
- If O_NDELAY is not set [see _o_p_e_n(2)], I_RECVFD will block
- until a message is present at the _s_t_r_e_a_m _h_e_a_d. If O_NDELAY
- is set, I_RECVFD will fail with _e_r_r_n_o set to EAGAIN if no
- message is present at the _s_t_r_e_a_m _h_e_a_d.
-
-
-
- PPPPaaaaggggeeee 9999
-
-
-
-
-
-
- SSSSTTTTRRRREEEEAAAAMMMMIIIIOOOO((((7777)))) SSSSTTTTRRRREEEEAAAAMMMMIIIIOOOO((((7777))))
-
-
-
- If the message at the _s_t_r_e_a_m _h_e_a_d is a message sent by an
- I_SENDFD, a new user file descriptor is allocated for the
- file pointer contained in the message. The new file
- descriptor is placed in the _f_d field of the _s_t_r_r_e_c_v_f_d
- structure. The structure is copied into the user data
- buffer pointed to by _a_r_g. On failure, _e_r_r_n_o is set to one
- of the following values:
-
- [EAGAIN] A message was not present at the _s_t_r_e_a_m _h_e_a_d
- read queue, and the O_NDELAY flag is set.
-
- [EBADMSG] The message at the _s_t_r_e_a_m _h_e_a_d read queue was
- not a message containing a passed file
- descriptor.
-
- [EFAULT] _a_r_g points outside the allocated address space.
-
- [EMFILE] NOFILES file descriptors are currently open.
-
- [ENXIO] Hangup received on _f_i_l_d_e_s.
-
- I_SETCLTIME Sets the stream head close time to the integer value pointed
- to by _a_r_g. The stream head close time is the maximum amount
- of time, in seconds, that the stream head will wait during
- close for the stream's output queues to empty before calling
- each module's or driver's close function. The default value
- is 15 seconds. On failure, _e_r_r_n_o is set to one of the
- following values:
-
- [EFAULT] _a_r_g points outside the allocated address space.
-
- [EINVAL] _a_r_g points to a value less than 0.
-
- I_GETCLTIME Returns the current value of the stream head close time
- (defined above) in the integer pointed to by _a_r_g. On
- failure, _e_r_r_n_o is set to one of the following values:
-
- [EFAULT] _a_r_g points outside the allocated address space.
-
- The following two commands are used for connecting and disconnecting
- multiplexed STREAMS configurations.
-
- I_LINK Connects two _s_t_r_e_a_m_s, where _f_i_l_d_e_s is the file descriptor of
- the _s_t_r_e_a_m connected to the multiplexing driver, and _a_r_g is
- the file descriptor of the _s_t_r_e_a_m connected to another
- driver. The _s_t_r_e_a_m designated by _a_r_g gets connected below
- the multiplexing driver. I_LINK requires the multiplexing
- driver to send an acknowledgement message to the _s_t_r_e_a_m _h_e_a_d
- regarding the linking operation. This call returns a
- multiplexor ID number (an identifier used to disconnect the
- multiplexor, see I_UNLINK) on success, and a -1 on failure.
- On failure, _e_r_r_n_o is set to one of the following values:
-
-
-
- PPPPaaaaggggeeee 11110000
-
-
-
-
-
-
- SSSSTTTTRRRREEEEAAAAMMMMIIIIOOOO((((7777)))) SSSSTTTTRRRREEEEAAAAMMMMIIIIOOOO((((7777))))
-
-
-
- [ENXIO] Hangup received on _f_i_l_d_e_s.
-
- [ETIME] Time out before acknowledgement message was
- received at _s_t_r_e_a_m _h_e_a_d.
-
- [EAGAIN] Temporarily unable to allocate storage to
- perform the I_LINK.
-
- [ENOSR] Unable to allocate storage to perform the
- I_LINK due to insufficient STREAMS memory
- resources.
-
- [EBADF] _a_r_g is not a valid, open file descriptor.
-
- [EINVAL] _f_i_l_d_e_s _s_t_r_e_a_m does not support multiplexing.
-
- [EINVAL] _a_r_g is not a _s_t_r_e_a_m, or is already linked under
- a multiplexor.
-
- [EINVAL] The specified link operation would cause a
- "cycle" in the resulting configuration; that
- is, if a given _s_t_r_e_a_m _h_e_a_d is linked into a
- multiplexing configuration in more than one
- place.
-
- An I_LINK can also fail while waiting for the multiplexing
- driver to acknowledge the link request, if a message
- indicating an error or a hangup is received at the _s_t_r_e_a_m
- _h_e_a_d of _f_i_l_d_e_s. In addition, an error code can be returned
- in the positive or negative acknowledgement message. For
- these cases, I_LINK will fail with _e_r_r_n_o set to the value in
- the message.
-
- I_UNLINK Disconnects the two _s_t_r_e_a_m_s specified by _f_i_l_d_e_s and _a_r_g.
- _f_i_l_d_e_s is the file descriptor of the _s_t_r_e_a_m connected to the
- multiplexing driver. _f_i_l_d_e_s must correspond to the _s_t_r_e_a_m
- on which the _i_o_c_t_l I_LINK command was issued to link the
- _s_t_r_e_a_m below the multiplexing driver. _a_r_g is the
- multiplexor ID number that was returned by the I_LINK. If
- _a_r_g is -1, then all Streams which were linked to _f_i_l_d_e_s are
- disconnected. As in I_LINK, this command requires the
- multiplexing driver to acknowledge the unlink. On failure,
- _e_r_r_n_o is set to one of the following values:
-
- [ENXIO] Hangup received on _f_i_l_d_e_s.
-
- [ETIME] Time out before acknowledgement message was
- received at _s_t_r_e_a_m _h_e_a_d.
-
- [ENOSR] Unable to allocate storage to perform the
- I_UNLINK due to insufficient STREAMS memory
- resources.
-
-
-
- PPPPaaaaggggeeee 11111111
-
-
-
-
-
-
- SSSSTTTTRRRREEEEAAAAMMMMIIIIOOOO((((7777)))) SSSSTTTTRRRREEEEAAAAMMMMIIIIOOOO((((7777))))
-
-
-
- [EINVAL] _a_r_g is an invalid multiplexor ID number or
- _f_i_l_d_e_s is not the _s_t_r_e_a_m on which the I_LINK
- that returned _a_r_g was performed.
-
- An I_UNLINK can also fail while waiting for the multiplexing
- driver to acknowledge the link request, if a message
- indicating an error or a hangup is received at the _s_t_r_e_a_m
- _h_e_a_d of _f_i_l_d_e_s. In addition, an error code can be returned
- in the positive or negative acknowledgement message. For
- these cases, I_UNLINK will fail with _e_r_r_n_o set to the value
- in the message.
-
- FIONREAD Counts the number of data bytes in data blocks in the first
- message on the _s_t_r_e_a_m _h_e_a_d read queue, and places this value
- in the location pointed to by _a_r_g. _a_r_g is assumed to be a
- pointer to an iiiinnnntttt.
-
- FIORDCHK Counts the number of data bytes in data blocks in the first
- message on the _s_t_r_e_a_m _h_e_a_d read queue, and returns this
- value.
-
- FIONBIO Enables or disables non-blocking mode, according to the
- boolean value of the contents of _a_r_g. _a_r_g is a pointer to
- an _i_n_t. Enabling this mode has the same effect as the
- OOOO____NNNNDDDDEEEELLLLAAAAYYYY flag for _o_p_e_n(2).
-
- SSSSEEEEEEEE AAAALLLLSSSSOOOO
- close(2), fcntl(2), intro(2), ioctl(2), open(2), read(2), getmsg(2),
- poll(2), putmsg(2), signal(2), sigset(2), write(2), termio(7)
-
- DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
- Unless specified otherwise above, the return value from _i_o_c_t_l is 0 upon
- success and -1 upon failure with _e_r_r_n_o set as indicated.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 11112222
-
-
-
-